<script>
  var num = 1;
  while (num <= 100) {
    console.log(num);
    num++;
  }
</script>

<script>
  var num = 5;
  do {
    console.log(num);   // 输出结果为：5和4
    num--;
  } while (num > 3);
</script>

<script>
  var i = 0;                // ①
  while (i < 5) {       // ②
    console.log('*');    // ③
    ++i;                // ④
  }
  // for ( ①; ②; ④ )
  for (var i = 0; i < 5; ++i) {
    console.log('*');    // ③
  }
</script>

<script>
  // let关键字
  for (let i = 0; i < 3; ++i) {
  }
  // 输出结果：i is not defined
  console.log(i); 

  // var关键字
  for (var i = 0; i < 3; ++i) {
  }
  // 输出结果为：3
  console.log(i);
</script>